package com.oceansoft.mobile.econsole.modules.weixin.service.impl;

import com.oceansoft.mobile.econsole.common.constant.ConfigInfo;
import com.oceansoft.mobile.econsole.common.util.HttpClientUtil;
import com.oceansoft.mobile.econsole.modules.weixin.service.IMatterQueryService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Service
@Transactional
public class MatterQueryServiceImpl implements IMatterQueryService {
    @Resource
    protected ConfigInfo configInfo;
    
	@Override
	public String carQuery(String license,String vin) {
		Map<String, String> param = new HashMap<String, String>();
		param.put("license", license);
		param.put("vin", vin);
		return HttpClientUtil.doPost("http://221.224.13.5:8190/econsole/api/query/violation/vehicle", param, "utf-8");
	}

	@Override
	public String driverQuery(String driverLincese,String fn) {
		Map<String, String> param = new HashMap<String, String>();
		param.put("drivingLicense", driverLincese);
		param.put("fn", fn);
		return HttpClientUtil.doPost("http://221.224.13.5:8190/econsole/api/query/violation/driver", param, "utf-8");
	}

	/**
     * 身份证办理进度
     *
     * @param idnum  身份证号
     * @param caseid 受理编号
     * @return Result
     */
	@Override
	public String loadIdCardScheduleDetail(String idnum, String caseid) {
		String url="http://221.224.13.5:8190/econsole/api/query/progress/idcard";
		Map<String, String> params;
		params = new HashMap<>();
		params.put("idCard", idnum);
		params.put("pendingId", caseid);
		 String response = HttpClientUtil.doPost(url, params, "utf-8");
		return response;
	}
			

}
